# -*- coding: utf-8 -*
from celeryapp import app, KProducer
from getPoint import get_cabinet_coding_points
from celeryapp.kafkaconfig import *

@app.task
def GetInfoDh(arg1, arg2):
    try:    
        result = get_cabinet_coding_points(arg1,arg2)
        ##发送到kafka
        kfk = KProducer()
        kfk.Connect(bootstrap_servers, topic,username,password)
        kfk.sendjsondata(result)

        print ('#####################')
        return result
    except Exception as identifier:
        return identifier
